package com.example.datajpatable.webapi;

import com.example.datajpatable.core.RUtil;
import com.example.datajpatable.domain.Student;
import com.example.datajpatable.service.StudentService;
import com.example.datajpatable.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/login")
public class LoginApiController {
    @Autowired
    private StudentService studentService;

    @GetMapping("/student")
    public R studnet(String name, String sno) throws Exception{
      Student student =   studentService.findBySnameAndSno(name,sno);
      return RUtil.success(student);
    }
}
